#include<stdio.h>
int main()
{
	int i = 0;
	int n;
	int min;
	int max;
	scanf("%d",&n);
	while(i<10)
	{
		max = n;
		scanf("%d",&n);
		if(max<n)
			max = n;
	}
	while(i<10)
	{
		min = n;
		scanf("%d",&n);
		if(min>n)
			max = n;
	}

	return 0;
}